﻿<UserControl x:Class="HTCHome.Gallery.GalleryItem"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Name="this"
             MinHeight="200" RenderTransformOrigin="0.5,0.5"
             Loaded="ThisLoaded">
    <UserControl.RenderTransform>
        <ScaleTransform x:Name="Scale"/>
    </UserControl.RenderTransform>
    <UserControl.Resources>
        <Storyboard x:Key="LoadAnim">
            <!--<DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleX" From="2" To="1" Duration="0:0:0.3" DecelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleY" From="2" To="1" Duration="0:0:0.3" DecelerationRatio="0.3"/>-->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleX" DecelerationRatio="0.3">
                <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="2" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.8" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleY" DecelerationRatio="0.3">
                <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="2" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.8" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimation Storyboard.TargetName="this" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.3"/>
        </Storyboard>
        <Storyboard x:Key="UnloadAnim" Completed="UnloadAnimCompleted">
            <DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleX" From="1" To="2" Duration="0:0:0.3" AccelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleY" From="1" To="2" Duration="0:0:0.3" AccelerationRatio="0.3"/>
            <DoubleAnimation Storyboard.TargetName="this" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.3"/>
        </Storyboard>
    </UserControl.Resources>
    <DockPanel>
        <Image Name="CloseButton" DockPanel.Dock="Bottom" Width="30" Source="/HTCHome;component/Resources/gallery_itemclose.png" Margin="0,0,0,0" MouseLeftButtonDown="CloseButtonMouseLeftButtonDown"/>
        <Border DockPanel.Dock="Top" Background="#77000000" BorderBrush="White" BorderThickness="1" CornerRadius="7" Margin="5" HorizontalAlignment="Center">
            <TextBlock Name="WidgetName" Foreground="White" Text="Widget Name" Margin="5" TextAlignment="Center"/>
        </Border>
        <Border Name="VisualBorder">
            <Border.Background>
                <VisualBrush x:Name="VisualBrush" Stretch="Uniform" />
            </Border.Background>
        </Border>
    </DockPanel>
</UserControl>
